package traceMyItems.business;

import java.util.logging.Logger;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;


@PersistenceCapable
public class User {
	private static final Logger log = Logger.getLogger(User.class.getName());
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key=null;
	
	@Persistent
	private String strUsername;
	@Persistent
	private String strPassword;
	@Persistent
	private String strFirstName;
	@Persistent
	private String strLastName;
	@Persistent
	private String strEmail;
	
	public void createKey() {
        this.key = KeyFactory.createKey(User.class.getSimpleName(), strUsername+":"+strEmail);
    }
	
	public Key getKey()
	{
		return key;
	}
	
	public String getUsername() {
		return strUsername;
	}
	public void setUsername(String strUsernameParam) {
		log.info("Username = "+strUsernameParam);
		this.strUsername = strUsernameParam;
	}
	public String getPassword() {
		return strPassword;
	}
	public void setPassword(String strPasswordParam) {
		log.info("Password = "+strPasswordParam);
		this.strPassword = strPasswordParam;
	}
	public String getFirstName() {
		return strFirstName;
	}
	public void setFirstName(String strFirstNameParam) {
		log.info("First Name= "+strFirstNameParam);
		this.strFirstName = strFirstNameParam;
	}
	public String getLastName() {
		return strLastName;
	}
	public void setLastName(String strLastNameParam) {
		log.info("Last Name= "+strLastNameParam);
		this.strLastName = strLastNameParam;
	}
	public String getEmail() {
		return strEmail;
	}
	public void setEmail(String strEmailParam) {
		log.info("Email= "+strEmailParam);
		this.strEmail = strEmailParam;
	}
	
}
